<template>
  <el-dialog v-model="visible" :title="title" :width="width" :before-close="close">
    <div class="scroll-container">
      <!-- 添加一个包裹容器，设置其高度和样式 -->
      <slot></slot>
    </div>
  </el-dialog>
</template>

<script setup lang="ts">
const props = defineProps({
  visible: {
    type: Boolean,
    default: true,
  },
  title: {
    type: String,
    default: '提示',
  },
  width: {
    type: String,
    default: '50%',
  },
})

const emit = defineEmits(['close'])

const close = () => {
  emit('close') // 触发 instance 事件，将 Echarts 实例暴露给父组件
}
</script>

<style scoped>
.scroll-container {
  padding-right: 20px;
}
</style>
